package reactor;

import org.junit.Test;
import reactor.core.publisher.Mono;
import util.Util;

import java.util.concurrent.CompletableFuture;

/**
 * @author yding5
 */
public class MonoTest {

    @Test
    public void testJust(){
        Mono.just(1).subscribe(Util::print);
    }

    @Test
    public void testFromCallable(){
        Mono.fromCallable(()->1).subscribe(Util::print);
    }

    @Test
    public void testFromCompletableFuture(){
        Mono.fromFuture(CompletableFuture.supplyAsync(()->1)).subscribe(Util::print);
    }
}
